<%@ page contentType="text/html;charset=utf-8" 
	import="org.springframework.web.context.*,com.zh.UserBean,org.springframework.web.context.support.*,com.zh.Util,java.util.*,com.zh.User,com.zh.Repair,com.zh.House"
%>
<html>
  <head>
    <title>修改报修信息</title>
     <script language="JavaScript" src="script/com.js"></script>
     <script language="JavaScript">
       function check(){
       	 
       	 document.all.ss.submit();
       }
     </script>
     <style>
      table{
	         border-collapse:collapse;
	       }
	       table,th,td {
	       
	       border:1px solid black;
	       }
	       .mima {
	       width:100%;
	       height:40px;
	       background-color:#ADD8E6;
	       }
	       .zi {
	       font-size:20px;
	       position:relative;
	       left:45%;
	       margin-left:-30px;
	       line-height:40px;
	       }
	</style>
  </head>
  <body>
 	<jsp:useBean id="userBean" class="com.zh.UserBean" scope="session"/>
 	<div class="mima"><font class="zi">修改报修信息</font></div>
	<% 
		Repair r = (Repair)request.getAttribute("object");
		//获取WebApplicationContext
		WebApplicationContext w=
		   WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
		Util util = (Util)w.getBean("Util");		
		String userId=r.getUserId();
		
		User user=(User)util.getObject("user",userId);
		String houseId=user.getHouseId();
		House house=(House)util.getObject("house",houseId);
	 %>
	<form action="SuperServlet" method="post" id="ss">
	<table width="80%" border="1" style="margin-left:150px;margin-top:15px">
	  <tr >
	    <td align="center">业主名:</td>
	    <td><%= user.getUsername() %></td>
	  </tr>
	  
	  <tr >
	    <td align="center">电话:</td>
	    <td><%= user.getPhonenumber() %></td>
	  </tr>
	  <tr >
	    <td align="center">报修时间:</td>
	    <td><input type="date" name="requesttime" id="rt" value="<%= r.getRequesttime() %>"/></td>
	  </tr>
	  
	  <tr >
	  	<td align="center">地址:</td>
	  	<td><%= house.getHouseaddress() %></td>
	  </tr>	 
	  <tr >
	  	<td align="center">报修内容:</td>
	  	<td><input name="requestmessage" id="rm" 
	  		value="<%= r.getRequestmessage() %>"/></td>
	  </tr>
	  <tr >
	  	<td align="center">完成状态:</td>
	  	<td>
	  		<select name="states">     	  
      	    	<option value="未处理">未处理</option>
      	    	<option value="已处理">已处理</option>     	   
      	  </select>
	  	</td>
	  </tr>
	   <tr>
		   <td  colspan="2" height="30px">
		   <div  style="position:relative;left:35%;">
		   <input type="button" value="提交" id="xg" onclick="JavaScript:check()" style="cursor:hand"/>
		   <input type="button" value="重置" id="cz" onclick="JavaScript:document.all.ss.reset()"  style="cursor:hand">
		   </div>
		   </td>
		 </tr> 
	</table>
	<input type="hidden" name="action" value="mdrepair"/>
	<input type="hidden" name="repairId" value="<%= r.getRepairId() %>"/>
	<input type="hidden" name="userId" value="<%= r.getUserId() %>"/>
	
	</form>
  </body>
</html>